#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
using namespace std;


int main() {
//	string pooh_pals[] = {
//			"Tigger", "Piglet", "Eeyore", "Rabbit"
//	};
//	vector<string> ppals(pooh_pals, pooh_pals + 4);
//	vector<string>::iterator iter = ppals.begin();
//	vector<string>::iterator iter_end = ppals.end();
//	
//	cout << "These are Pooh's pals : ";
//	copy(iter, iter_end, ostream_iterator<string>(cout, " "));
//	cout << endl;
	istream_iterator<string> in(cin), eos;
	vector<string> text;
	
	copy(in, eos, back_insert(text));
	
	sort(text.begin(), text.end());
	
	vector<string>::iterator it;
	it = unique(text.begin(), text.end());
	text.erase(text.begin(), text.end());
	
	int line_cnt = 1;
	for(vector<string>::iterator iter = text.begin();
		iter != text.end(); ++iter, ++line__cnt)
		cout << *iter << (line_cnt % 9 ? " " : "\n");
	cout << endl;
}
